﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12_Facade
{
    //子系统1
    class SubSystem1
    {
        public void SubSystem1Method()
        {
            Console.WriteLine("子系统1方法");
        }
    }
    //子系统2
    class SubSystem2
    {
        public void SubSystem1Method()
        {
            Console.WriteLine("子系统2方法");
        }
    }
    //子系统3
    class SubSystem3
    {
        public void SubSystem1Method()
        {
            Console.WriteLine("子系统3方法");
        }
    }

    //外观者模式 抽象隔离
    class Facade
    {
        SubSystem1 subSystem1;
        SubSystem2 subSystem2;
        SubSystem3 subSystem3;
        public Facade()
        {
            subSystem1 = new SubSystem1();
            subSystem2 = new SubSystem2();
            subSystem3 = new SubSystem3();
        }
        public void FacadeMethod()
        {
            subSystem1.SubSystem1Method();
            subSystem2.SubSystem1Method();
            subSystem3.SubSystem1Method();
        }
    }
}
